<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<span dojoType="dojo.data.ItemFileWriteStore" jsId="wishStore3" url="portal/part/grid.json">
</span>

<table editable="true"  id="gridx3" 
dojoType="dojox.grid.EnhancedGrid" store="wishStore3"
query="{ description: '*' }" clientSort="true"

data-dojo-props="plugins:{ filter: {closeFilterbarButton: true,ruleCount: 5, itemsName: 'songs' },
		indirectSelection: {
            	headerSelector:true, 
            	width:'40px', 
            	styles:'text-align: center;'
},pagination: {
              pageSizes: ['25', '50', '100', 'All'],
              description: true,
              sizeSwitch: true,
              pageStepper: true,
              gotoButton: true,
              maxPageStep: 4,
              position: 'bottom'
            },menus:{
            	selectedRegionMenu:'selectedRegionMenu'}
            
            },rowSelector: '20px',
            selectionMode:'single' 
    
    "

 ><!-- 
            	rowMenu:'rowMenu'
 				headerMenu:'headerMenu', 
            	cellMenu:'cellMenu', 
    			
    			selectionMode:'single' 
    			
    			onRowSelectCell onRowClick
    -->
<script type="dojo/connect" event="onSelected" args="evt" >
	
	//var des = this.store._arrayOfTopLevelItems[evt.rowIndex].description;
	//var size = this.store._arrayOfTopLevelItems[evt.rowIndex].size;
	//var origin = this.store._arrayOfTopLevelItems[evt.rowIndex].origin;
	//var wrapper = this.store._arrayOfTopLevelItems[evt.rowIndex].wrapper;
	//var shape = this.store._arrayOfTopLevelItems[evt.rowIndex].shape;
	//  alert(des);
	return true;
</script>
<script type="dojo/connect" event="onDeselected" args="evt" >
	
	//var des = this.store._arrayOfTopLevelItems[evt.rowIndex].description;
	//var size = this.store._arrayOfTopLevelItems[evt.rowIndex].size;
	//var origin = this.store._arrayOfTopLevelItems[evt.rowIndex].origin;
	//var wrapper = this.store._arrayOfTopLevelItems[evt.rowIndex].wrapper;
	//var shape = this.store._arrayOfTopLevelItems[evt.rowIndex].shape;
	//alert(des);
	return false;
</script>
<script type="dojo/connect" event="onRowClick" args="evt" >
	var des = this.store._arrayOfTopLevelItems[evt.rowIndex].description;
	//var size = this.store._arrayOfTopLevelItems[evt.rowIndex].size;
	//var origin = this.store._arrayOfTopLevelItems[evt.rowIndex].origin;
	//var wrapper = this.store._arrayOfTopLevelItems[evt.rowIndex].wrapper;
	//var shape = this.store._arrayOfTopLevelItems[evt.rowIndex].shape;
	//alert(des);
	//return false;
</script>

<script type="dojo/connect" event="onRowContextMenu" args="evt" >
	rowIndex = evt.rowIndex;
    var colIndex = evt.cellIndex;
	var des = this.store._arrayOfTopLevelItems[rowIndex].description;
	//var size = this.store._arrayOfTopLevelItems[rowIndex].size;
	//var origin = this.store._arrayOfTopLevelItems[rowIndex].origin;
	//var wrapper = this.store._arrayOfTopLevelItems[rowIndex].wrapper;
	//var shape = this.store._arrayOfTopLevelItems[rowIndex].shape;
	//alert(des);
	//return false;
</script>



<thead>
<tr>

<th field="description"  width="252px" >Cigar</th>
<th field="size"  editable="true">Length/Ring</th>
<th field="origin" >Origin</th>
<th field="wrapper" >Wrapper</th>
<th field="shape" >Shape</th>
</tr>
</thead>
</table> 


<!-- iconClass:'dijitEditorIcon dijitEditorIconCut',
	dijitEditorIcon dijitEditorIconCut
	dijitEditorIcon dijitEditorIconCopy
	dijitEditorIcon dijitEditorIconPaste
 -->
    <div data-dojo-type="dijit.Menu" id="headerMenu" style="display: none;">
        <div data-dojo-type="dijit.MenuItem" >Header Menu Item 1</div>
    </div>
    <div data-dojo-type="dijit.Menu" id="rowMenu" style="display: none;">
        <div data-dojo-type="dijit.MenuItem">Row Menu Item 2</div>
    </div>
    <div data-dojo-type="dijit.Menu" id="cellMenu" style="display: none;">
        <div data-dojo-type="dijit.MenuItem">Cell Menu Item 3</div>
    </div>
    <div data-dojo-type="dijit.Menu" id="selectedRegionMenu" style="display: none;">
        <div data-dojo-type="dijit.MenuItem" data-dojo-props="
        onClick:function(e){alert(e.type+'-'+rowIndex+' not actually cutting anything, just a test!')}">Edit</div>
        
        <div data-dojo-type="dijit.MenuItem" data-dojo-props="
        onClick:function(e){
        	/* var dlg = new dojox.widget.DialogSimple({ 
        	 	title:'Bar', 
        	 	executeScripts:true, 
        	 	href:'portal/adminV1/usermanage/edit.jsp?objid='+rowIndex });
		     dlg.startup(); 
		     dlg.show();
		     */
		      dijit.byId('dialogOne').show();
        }">Delete</div>
        
    </div>


<div id="dialogOne" data-dojo-type="dijit.Dialog" title="My Dialog Title">
    <div data-dojo-type="dijit.layout.TabContainer" style="width: 200px; height: 300px;">
        <div data-dojo-type="dijit.layout.ContentPane" title="foo">Content of Tab "foo"</div>
        <div data-dojo-type="dijit.layout.ContentPane" title="boo">Hi, I'm Tab "boo"</div>
    </div>
</div>